package com.ruoyi.fallbackFactory;

import com.ruoyi.common.core.web.domain.AjaxResult;
import com.ruoyi.domain.ResidentTask;
import com.ruoyi.feign.ResidentTaskFeignClient;
import org.springframework.cloud.openfeign.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * @author 小林同学
 * @version 1.0
 * @description: TODO
 * @date 2023/4/10 17:05
 */
@Component
public class ResidentTaskFeignClientFallbackFactory implements FallbackFactory<ResidentTaskFeignClient> {


    @Override
    public ResidentTaskFeignClient create(Throwable cause) {
        cause.printStackTrace();
        return new ResidentTaskFeignClient() {
            @Override
            public AjaxResult add(ResidentTask residentTask) {
                return AjaxResult.error("走荣断了");
            }
        };
    }
}
